using HelpDeskTool.Extensions;

namespace HelpDeskTool.Entities.Devices;

public class RamModule : Device
{
	public uint Capacity { get; init; }

	public uint Speed { get; init; }

	public override string ToString()
	{
		var strBuilder = new List<string>(3);

		if (Capacity > 0)
			strBuilder.Add(Capacity >= 1000 ? $"{Capacity / 1000} GB" : $"{Capacity} MB");

		if (Speed > 0)
			strBuilder.Add($"{Speed} MHz");

		if (!string.IsNullOrWhiteSpace(ModelName))
			strBuilder.Add(ModelName);

		return strBuilder.ToStringWithDelimiter();
	}
}
